package exception.exception02;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("开始了");
        try {
            String s2 = "abc";
            String s1 = "";
            // String s1 = null;
            System.out.println(Integer.parseInt(s2));
            System.out.println(s1.charAt(0));
        } catch (NullPointerException e) {
            System.out.println("输入有误");
            e.printStackTrace();
        }catch (StringIndexOutOfBoundsException e){
            System.out.println("数组下表越界异常");
        }catch (Exception e){
            System.out.println("有很大的错误");
        }

        System.out.println("结束了");


    }
}
